﻿using System;
using UnityEngine;

// Token: 0x02000297 RID: 663
public class AISMG : AIGun
{
	// Token: 0x170001BC RID: 444
	// (get) Token: 0x06000EBB RID: 3771 RVA: 0x00070CF8 File Offset: 0x0006EEF8
	public override int AnimGunType
	{
		get
		{
			return 2;
		}
	}

	// Token: 0x170001BD RID: 445
	// (get) Token: 0x06000EBC RID: 3772 RVA: 0x00070CF8 File Offset: 0x0006EEF8
	public override int AnimLayer
	{
		get
		{
			return 2;
		}
	}

	// Token: 0x170001BE RID: 446
	// (get) Token: 0x06000EBD RID: 3773 RVA: 0x00070CFB File Offset: 0x0006EEFB
	public override string AnimTransitionName
	{
		get
		{
			return "SMG Aim Layer.Idle -> SMG Aim Layer.Aiming";
		}
	}

	// Token: 0x06000EBE RID: 3774 RVA: 0x00070D02 File Offset: 0x0006EF02
	protected override void Start()
	{
		this.defaultFiringAudioClip = SoundManager.This.npcSmgProjFireSound;
		base.Start();
	}

	// Token: 0x06000EBF RID: 3775 RVA: 0x00070A69 File Offset: 0x0006EC69
	public override void Fire()
	{
		this.Fire(0f);
	}

	// Token: 0x06000EC0 RID: 3776 RVA: 0x00070D1C File Offset: 0x0006EF1C
	public override void Fire(float inaccurracyFactor)
	{
		float x = this.owner.transform.localScale.x;
		Vector3 position = this.firingPoint.position + this.firingPoint.forward * x;
		GameObject gameObject = UnityEngine.Object.Instantiate<GameObject>(this.projectilePrefab, position, base.transform.rotation);
		if (inaccurracyFactor > 0f)
		{
			gameObject.transform.Rotate(UnityEngine.Random.Range(0f, inaccurracyFactor), UnityEngine.Random.Range(0f, inaccurracyFactor), 0f);
		}
		AISMGProjectile component = gameObject.GetComponent<AISMGProjectile>();
		this.projectileScaleMult = 2.5f;
		if (this.projectileColor != Color.clear)
		{
			component.Initialize(this.owner.GetComponent<EntityBase>(), this.projectileSpeedMult, x * this.projectileScaleMult, this.projectileColor);
		}
		else
		{
			component.Initialize(this.owner.GetComponent<EntityBase>(), this.projectileSpeedMult, x * this.projectileScaleMult);
		}
		if (this.customProjectileImpactAudioClip != null)
		{
			component.SetSoundClip(this.customProjectileImpactAudioClip);
		}
		this.muzzleFlash.Emit(10);
		this.firingAudioSource.Play();
	}

	// Token: 0x040013BF RID: 5055
	[SerializeField]
	private ParticleSystem muzzleFlash;
}
